package org.joseph.springcloud.config;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
public class FeignConsumerConfig {

    /*
    *   IRule
    *   1、AvailabilityFilteringRule 过滤掉跳闸，服务故障的服务，对剩下的进行轮询
    *   2、RandomRule  随机
    *   3、RoundRobinRule 轮询
    *   4、RetryRule 先按照轮询获取服务，如果服务获取失败，则会在指定时间进行重试
    *   5、
    */

    @Bean
    public IRule rule(){
        return new RandomRule();
    }

}
